package com.vmj.test.example;

/**
 * Created by yangshoujun on 2017/9/16 下午8:40.
 */
public class InstanceOf {

    public static void main(String[] args) {
        Object object = new MyObject();
        if(object instanceof MyObject) {
            System.out.println("ok...");
        }

        if(object instanceof OtherObject) {
            System.out.println("ok...");
        } else {
            System.out.println("not instance of OtherObject");
        }
    }
}
